using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class vt_vglintegrityMap : EntityTypeConfiguration<vt_vglintegrity>
    {
        public vt_vglintegrityMap()
        {
            // Primary Key
            this.HasKey(t => new { t.batch, t.origin });

            // Properties
            this.Property(t => t.batch)
                .IsRequired()
                .HasMaxLength(8);

            this.Property(t => t.origin)
                .IsRequired()
                .HasMaxLength(2);

            // Table & Column Mappings
            this.ToTable("vt_vglintegrity");
            this.Property(t => t.batch).HasColumnName("batch");
            this.Property(t => t.Debit_base2).HasColumnName("Debit_base2");
            this.Property(t => t.Credit_base2).HasColumnName("Credit_base2");
            this.Property(t => t.Debit_base1).HasColumnName("Debit_base1");
            this.Property(t => t.Credit_base1).HasColumnName("Credit_base1");
            this.Property(t => t.origin).HasColumnName("origin");
        }
    }
}
